import request from '@/utils/request'

// 查询雇员列表
export function listEmployee(query) {
  return request({
    url: '/business/employee/base/list',
    method: 'get',
    params: query
  })
}

// 查询雇员详细
export function getEmployee(id) {
  return request({
    url: '/business/employee/base/' + id,
    method: 'get'
  })
}

// 新增雇员
export function addEmployee(data) {
  return request({
    url: '/business/employee/base',
    method: 'post',
    data: data
  })
}

// 修改雇员
export function updateEmployee(data) {
  return request({
    url: '/business/employee/base',
    method: 'put',
    data: data
  })
}

// 删除雇员
export function delEmployee(id) {
  return request({
    url: '/business/employee/base/' + id,
    method: 'delete'
  })
}

// 发送密码
export function sendPassword(id) {
  return request({
    url: '/business/employee/base/sendPassword/' + id,
    method: 'POST'
  })
}


export function getPlan(empId) {
  return request({
    url: '/business/employeeSpecialContribution/getSpecialContributionList/' + empId,
    method: 'get'
  })
}
export function employeeSpecialContribution(id) {
  return request({
    url: '/business/employeeSpecialContribution/' + id,
    method: 'get'
  })
}

//关联供款计划
export function updatePlan(data) {
  return request({
    url: '/business/employeeSpecialContribution',
    method: 'put',
    data: data
  })
}

// 职位信息
export function getPositionList(query) {
  return request({
    url: '/business/position/list',
    method: 'get',
    params: query
  })
}

//薪酬组数据
export function getSalaryGroupList(query) {
  return request({
    url: '/salary/salaryGroup/listAll',
    method: 'get',
    params: query
  })
}

export function getEmployerSalaryGroup(query) {
  return request({
    url: '/salary/salaryGroup/getEmployerSalaryGroup',
    method: 'get',
    params: query
  })
}
//绩效组
export function getPerformanceGroupList(query) {
  return request({
    url: '/business/jxPerformanceGroup/list',
    method: 'get',
    params: query
  })
}
//  查询对应雇主得绩效组列表
export function getEmployerPerformanceGroup(query) {
  return request({
    url: '/business/jxPerformanceGroup/getEmployerPerformanceGroup',
    method: 'get',
    params: query
  })
}
//假期组
export function getVacationGroupList(query) {
  return request({
    url: '/business/jqVacationGroup/list',
    method: 'get',
    params: query
  })
}

//假期组
export function getEmployerVacationGroup(query) {
  return request({
    url: 'business/jqVacationGroup/getEmployerVacationGroup',
    method: 'get',
    params: query
  })
}
//考勤组
export function getCheckWorkGroupList(query) {
  return request({
    url: '/business/attendanceGroupEmployer/getAttendanceGroupByEmployerId',
    method: 'get',
    params: query
  })
}
// 查询雇主下的考勤组
export function getAttendanceGroupByEmployerId(query) {
  return request({
    url: '/business/attendanceGroupEmployer/getAttendanceGroupByEmployerId',
    method: 'get',
    params: query
  })
}

//雇员档案
export function getChangeRecord(params) {
  return request({
    url: `/business/employeeProfile/list`,
    method: 'get',
    params
  })
}
//雇员档案详情
export function employeeProfile(id) {
  return request({
    url: `/business/employeeProfile/${id}`,
    method: 'get'
  })
}
//根据雇员id查询雇主列表
export function findEmployers(id) {
  return request({
    url: `/business/employee/base/findEmployers/${id}`,
    method: 'post'
  })
}
export function pageListByEmployer(params) {
  return request({
    url: `/business/employee/base/pageListByEmployer`,
    method: 'get',
    params
  })
}
export function scheduleEmployeeList(params) {
  return request({
    url: `/business/shiftSchedule/scheduleEmployeeList`,
    method: 'get',
    params
  })
}